import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import 'package:flutter_framework/controllers/user_controller.dart';

class AuthMiddleWare extends GetMiddleware {
  @override
  RouteSettings? redirect(String? route) {
    final userController = Get.put(UserController());
    if (!userController.isLoggedIn()) {
      return const RouteSettings(name: '/Login');
    } else {
      return null;
    }
  }
}
